class code1 {
    // 字符串相加
    //模拟
    public String addStrings(String num1, String num2) {
        StringBuffer sb = new StringBuffer();
        int ine = 0;
        int i = num1.length()-1;
        int j = num2.length()-1;
        while(i>=0 || j>= 0) {
            int x1 = i>=0 ? num1.charAt(i) - '0':0;
            int x2 = j>=0 ? num2.charAt(j) - '0':0;
            int x = x1 + x2 + ine;
            i--;
            j--;
            ine = x/10;
            sb.append(x % 10);
        }
        //还有最后一个进位一位没有加
        if(ine == 1) {
            sb.append(1);
        }
        return sb.reverse().toString();
    }
}